package com.shd.edanpei.ui.adapter;

import android.content.Context;
import android.view.View;
import android.widget.ImageView;

import com.chad.library.adapter.base.BaseViewHolder;
import com.shd.edanpei.R;
import com.shd.edanpei.base.BaseQuickImageAdapter;
import com.shd.edanpei.bean.MessageModel;

public class MeMsgAdapter extends BaseQuickImageAdapter<MessageModel> {

    public MeMsgAdapter(Context context) {
        super(context, R.layout.item_me_message);
    }

    @Override
    protected void convert(BaseViewHolder helper, MessageModel item) {
//        int layoutPosition = helper.getLayoutPosition();
//        if (layoutPosition == 0) {
//            helper.getView(R.id.tv_message_top).setVisibility(View.VISIBLE);
//        } else {
//            helper.getView(R.id.tv_message_top).setVisibility(View.GONE);
//        }
        if (item.isStatus()) {
            //未读
            helper.getView(R.id.iv_status).setVisibility(View.VISIBLE);
        } else {
            //已读
            helper.getView(R.id.iv_status).setVisibility(View.GONE);
        }

        helper.setText(R.id.time, item.getCreateTime())
                .setText(R.id.tv_info, item.getMessage())
                .setText(R.id.tv_title, item.getModelMsg());
               // .setText(R.id.tv_message_title, item.getTitle());
//        helper.setText(R.id.tv_message_title, item.getTitle())
//                .setText(R.id.tv_message_content, item.getContent())
//                .setText(R.id.tv_message_time, item.getCreateTime());
    }
}
